package 连接池;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import javax.sql.DataSource;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;
/**
 * 功能描述：
 * @Author: ygq
 * @Date: 2021/12/8 21:33
 */
public class DruidDemo {
    public static void main(String[] args) throws Exception {
        Properties properties = new Properties();
        InputStream stream = DruidDemo.class.getClassLoader().getResourceAsStream("druid.properties");
        properties.load(stream);
        DataSource dataSource = DruidDataSourceFactory.createDataSource(properties);
        Connection connection = dataSource.getConnection();
        System.out.println(connection);
    }
}
